home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Languages / RLaB 1.18c / manual / input.tex < prev    next >
LaTeX Document  |  1994-05-01  |  1.9 KB  |  [TEXT/ttxt]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: LaTeX Document (document/latex).

You can browse this item here: input.tex

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert LaTeX Document (document/latex) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file LaTeX document text default
99% file LaTeX document, ASCII text, with CR line terminators default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/281 LaTeX (Subdocument) default
100% detectItEasy Format: plain text[CR] default (weak)


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[ttxt]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 73 65 63 74 69 6f 6e | 7b 69 6e 70 75 74 20 2d |\section|{input -|
|00000010| 2d 2d 20 47 65 74 20 75 | 73 65 72 20 72 65 73 70 |-- Get u|ser resp|
|00000020| 6f 6e 73 65 7d 0d 5c 6c | 61 62 65 6c 7b 66 6e 3a |onse}.\l|abel{fn:|
|00000030| 69 6e 70 75 74 7d 0d 5c | 69 6e 64 65 78 7b 69 6e |input}.\|index{in|
|00000040| 70 75 74 28 29 7d 0d 5c | 69 6e 64 65 78 7b 67 65 |put()}.\|index{ge|
|00000050| 74 20 75 73 65 72 20 72 | 65 73 70 6f 6e 73 65 7d |t user r|esponse}|
|00000060| 0d 5c 69 6e 64 65 78 7b | 75 73 65 72 20 69 6e 70 |.\index{|user inp|
|00000070| 75 74 7d 0d 5c 62 65 67 | 69 6e 7b 72 61 69 6c 7d |ut}.\beg|in{rail}|
|00000080| 0d 49 6e 70 75 74 20 3a | 20 27 69 6e 70 75 74 27 |.Input :| 'input'|
|00000090| 20 27 28 27 20 53 74 72 | 69 6e 67 20 28 27 2c 27 | '(' Str|ing (','|
|000000a0| 20 27 22 73 22 27 20 29 | 20 3f 20 27 29 27 20 3b | '"s"' )| ? ')' ;|
|000000b0| 0d 5c 65 6e 64 7b 72 61 | 69 6c 7d 0d 0d 54 68 65 |.\end{ra|il}..The|
|000000c0| 20 5c 76 65 72 62 2b 69 | 6e 70 75 74 2b 20 66 75 | \verb+i|nput+ fu|
|000000d0| 6e 63 74 69 6f 6e 20 70 | 72 6f 76 69 64 65 73 20 |nction p|rovides |
|000000e0| 61 6e 20 65 61 73 79 20 | 6d 65 74 68 6f 64 20 66 |an easy |method f|
|000000f0| 6f 72 20 75 73 65 72 73 | 20 74 6f 20 67 65 74 20 |or users| to get |
|00000100| 61 0d 73 69 6d 70 6c 65 | 20 72 65 73 70 6f 6e 73 |a.simple| respons|
|00000110| 65 20 66 72 6f 6d 20 74 | 68 65 20 6b 65 79 62 6f |e from t|he keybo|
|00000120| 61 72 64 2e 20 54 68 65 | 20 73 74 72 69 6e 67 20 |ard. The| string |
|00000130| 61 72 67 75 6d 65 6e 74 | 20 69 73 20 70 72 69 6e |argument| is prin|
|00000140| 74 65 64 0d 6f 6e 20 74 | 68 65 20 73 74 61 6e 64 |ted.on t|he stand|
|00000150| 61 72 64 20 6f 75 74 70 | 75 74 20 28 75 73 75 61 |ard outp|ut (usua|
|00000160| 6c 6c 79 20 74 68 65 20 | 73 63 72 65 65 6e 29 2c |lly the |screen),|
|00000170| 20 61 6e 64 20 74 68 65 | 20 70 72 6f 67 72 61 6d | and the| program|
|00000180| 20 77 61 69 74 73 0d 66 | 6f 72 20 74 68 65 20 75 | waits.f|or the u|
|00000190| 73 65 72 20 72 65 73 70 | 6f 6e 73 65 2e 20 5c 76 |ser resp|onse. \v|
|000001a0| 65 72 62 2b 69 6e 70 75 | 74 2b 20 74 68 65 6e 20 |erb+inpu|t+ then |
|000001b0| 72 65 74 75 72 6e 73 20 | 74 68 65 20 69 6e 70 75 |returns |the inpu|
|000001c0| 74 2c 20 77 68 69 63 68 | 20 63 61 6e 20 62 65 0d |t, which| can be.|
|000001d0| 65 69 74 68 65 72 20 61 | 20 73 74 72 69 6e 67 2c |either a| string,|
|000001e0| 20 6f 72 20 61 20 6e 75 | 6d 62 65 72 2e 20 49 66 | or a nu|mber. If|
|000001f0| 20 79 6f 75 20 77 61 6e | 74 20 74 6f 20 66 6f 72 | you wan|t to for|
|00000200| 63 65 20 74 68 65 20 69 | 6e 70 75 74 20 74 6f 20 |ce the i|nput to |
|00000210| 62 65 0d 61 20 73 74 72 | 69 6e 67 2c 20 74 68 65 |be.a str|ing, the|
|00000220| 6e 20 75 73 65 20 74 68 | 65 20 6f 70 74 69 6f 6e |n use th|e option|
|00000230| 61 6c 20 73 65 63 6f 6e | 64 20 61 72 67 75 6d 65 |al secon|d argume|
|00000240| 6e 74 2c 20 5c 76 65 72 | 62 2b 22 73 22 2b 2c 20 |nt, \ver|b+"s"+, |
|00000250| 74 6f 20 66 6f 72 63 65 | 0d 74 68 65 20 72 65 74 |to force|.the ret|
|00000260| 75 72 6e 20 76 61 6c 75 | 65 20 74 6f 20 62 65 20 |urn valu|e to be |
|00000270| 61 20 73 74 72 69 6e 67 | 2e 20 20 41 63 74 75 61 |a string|. Actua|
|00000280| 6c 6c 79 20 61 6e 79 20 | 61 72 67 75 6d 65 6e 74 |lly any |argument|
|00000290| 20 77 69 6c 6c 20 64 6f | 20 2d 2d 2d 20 0d 6a 75 | will do| --- .ju|
|000002a0| 73 74 20 73 6f 20 6c 6f | 6e 67 20 61 73 20 74 68 |st so lo|ng as th|
|000002b0| 65 72 65 20 69 73 20 73 | 6f 6d 65 20 61 72 67 75 |ere is s|ome argu|
|000002c0| 6d 65 6e 74 2e 0d 0d 49 | 66 20 74 68 65 20 75 73 |ment...I|f the us|
|000002d0| 65 72 20 6a 75 73 74 20 | 68 69 74 73 20 72 65 74 |er just |hits ret|
|000002e0| 75 72 6e 20 77 68 65 6e | 20 70 72 6f 6d 70 74 65 |urn when| prompte|
|000002f0| 64 2c 20 74 68 65 6e 20 | 5c 76 65 72 62 2b 69 6e |d, then |\verb+in|
|00000300| 70 75 74 2b 0d 72 65 74 | 75 72 6e 73 20 61 6e 20 |put+.ret|urns an |
|00000310| 65 6d 70 74 79 20 6d 61 | 74 72 69 78 2e 0d 0d 24 |empty ma|trix...$|
|00000320| 5c 4c 6f 6e 67 72 69 67 | 68 74 61 72 72 6f 77 24 |\Longrig|htarrow$|
|00000330| 20 54 68 69 73 20 69 73 | 20 6e 6f 74 20 61 6e 20 | This is| not an |
|00000340| 5c 52 4c 61 42 5c 20 62 | 75 69 6c 74 2d 69 6e 20 |\RLaB\ b|uilt-in |
|00000350| 66 75 6e 63 74 69 6f 6e | 2e 20 20 54 68 69 73 20 |function|. This |
|00000360| 66 75 6e 63 74 69 6f 6e | 0d 69 73 20 6e 6f 72 6d |function|.is norm|
|00000370| 61 6c 6c 79 20 6c 6f 61 | 64 65 64 20 6f 6e 20 73 |ally loa|ded on s|
|00000380| 74 61 72 74 2d 75 70 20 | 66 72 6f 6d 20 74 68 65 |tart-up |from the|
|00000390| 20 5c 76 65 72 62 2b 69 | 6e 70 75 74 2e 72 2b 20 | \verb+i|nput.r+ |
|000003a0| 66 69 6c 65 20 69 6e 20 | 74 68 65 0d 73 74 61 6e |file in |the.stan|
|000003b0| 64 61 72 64 20 5c 76 65 | 72 62 2b 72 6c 69 62 2b |dard \ve|rb+rlib+|
|000003c0| 20 64 69 72 65 63 74 6f | 72 79 2e 20 55 73 65 20 | directo|ry. Use |
|000003d0| 6f 66 20 74 68 65 20 5c | 76 65 72 62 2b 2d 72 2b |of the \|verb+-r+|
|000003e0| 20 6f 70 74 69 6f 6e 2c | 20 69 6e 63 6f 72 72 65 | option,| incorre|
|000003f0| 63 74 6c 79 20 0d 73 65 | 74 74 69 6e 67 20 74 68 |ctly .se|tting th|
|00000400| 65 20 5c 76 65 72 62 2b | 52 4c 41 42 5f 4c 49 42 |e \verb+|RLAB_LIB|
|00000410| 5f 44 49 52 2b 20 65 6e | 76 69 72 6f 6e 6d 65 6e |_DIR+ en|vironmen|
|00000420| 74 61 6c 20 76 61 72 69 | 61 62 6c 65 2c 20 6f 72 |tal vari|able, or|
|00000430| 20 6d 6f 64 69 66 79 69 | 6e 67 0d 5c 76 65 72 62 | modifyi|ng.\verb|
|00000440| 2b 69 6e 70 75 74 2e 72 | 2b 20 6d 61 79 20 6d 61 |+input.r|+ may ma|
|00000450| 6b 65 20 74 68 69 73 20 | 66 75 6e 63 74 69 6f 6e |ke this |function|
|00000460| 20 75 6e 61 76 61 69 6c | 61 62 6c 65 2e 0d 0d 0d | unavail|able....|
|00000470| 5c 70 61 72 61 67 72 61 | 70 68 7b 45 78 61 6d 70 |\paragra|ph{Examp|
|00000480| 6c 65 7d 0d 5c 69 6e 64 | 65 78 7b 65 78 61 6d 70 |le}.\ind|ex{examp|
|00000490| 6c 65 20 6f 66 20 69 6e | 70 75 74 28 29 7d 0d 5c |le of in|put()}.\|
|000004a0| 69 6e 64 65 78 7b 69 6e | 70 75 74 28 29 21 65 78 |index{in|put()!ex|
|000004b0| 61 6d 70 6c 65 7d 0d 5c | 62 65 67 69 6e 7b 76 65 |ample}.\|begin{ve|
|000004c0| 72 62 61 74 69 6d 7d 0d | 3e 20 72 65 73 70 6f 6e |rbatim}.|> respon|
|000004d0| 73 65 20 3d 20 69 6e 70 | 75 74 28 22 44 6f 6e 27 |se = inp|ut("Don'|
|000004e0| 74 20 6a 75 73 74 20 73 | 74 61 6e 64 20 74 68 65 |t just s|tand the|
|000004f0| 72 65 21 20 44 6f 20 73 | 6f 6d 65 74 68 69 6e 67 |re! Do s|omething|
|00000500| 3a 22 29 3b 0d 44 6f 6e | 27 74 20 6a 75 73 74 20 |:");.Don|'t just |
|00000510| 73 74 61 6e 64 20 74 68 | 65 72 65 21 20 44 6f 20 |stand th|ere! Do |
|00000520| 73 6f 6d 65 74 68 69 6e | 67 3a 74 65 78 74 20 6e |somethin|g:text n|
|00000530| 75 6d 62 65 72 0d 3e 20 | 72 65 73 70 6f 6e 73 65 |umber.> |response|
|00000540| 0d 20 72 65 73 70 6f 6e | 73 65 20 3d 0d 74 65 78 |. respon|se =.tex|
|00000550| 74 0d 3e 20 72 65 73 70 | 6f 6e 73 65 32 20 3d 20 |t.> resp|onse2 = |
|00000560| 69 6e 70 75 74 28 22 44 | 6f 6e 27 74 20 6a 75 73 |input("D|on't jus|
|00000570| 74 20 73 74 61 6e 64 20 | 74 68 65 72 65 21 20 44 |t stand |there! D|
|00000580| 6f 20 73 6f 6d 65 74 68 | 69 6e 67 3a 22 29 3b 0d |o someth|ing:");.|
|00000590| 44 6f 6e 27 74 20 6a 75 | 73 74 20 73 74 61 6e 64 |Don't ju|st stand|
|000005a0| 20 74 68 65 72 65 21 20 | 44 6f 20 73 6f 6d 65 74 | there! |Do somet|
|000005b0| 68 69 6e 67 3a 22 73 65 | 6e 74 61 6e 63 65 20 77 |hing:"se|ntance w|
|000005c0| 69 74 68 20 77 6f 72 64 | 73 22 0d 3e 20 72 65 73 |ith word|s".> res|
|000005d0| 70 6f 6e 73 65 32 0d 20 | 72 65 73 70 6f 6e 73 65 |ponse2. |response|
|000005e0| 32 20 3d 0d 73 65 6e 74 | 61 6e 63 65 20 77 69 74 |2 =.sent|ance wit|
|000005f0| 68 20 77 6f 72 64 73 0d | 3e 20 4e 75 6d 62 65 72 |h words.|> Number|
|00000600| 20 3d 20 69 6e 70 75 74 | 28 22 47 69 6d 6d 65 20 | = input|("Gimme |
|00000610| 61 20 6e 75 6d 62 65 72 | 3a 22 29 0d 47 69 6d 6d |a number|:").Gimm|
|00000620| 65 20 61 20 6e 75 6d 62 | 65 72 3a 33 2e 32 34 35 |e a numb|er:3.245|
|00000630| 0d 20 4e 75 6d 62 65 72 | 20 3d 0d 20 20 20 20 20 |. Number| =. |
|00000640| 33 2e 32 35 0d 3e 20 73 | 68 6f 77 28 4e 75 6d 62 |3.25.> s|how(Numb|
|00000650| 65 72 29 0d 20 20 20 6e | 61 6d 65 3a 20 20 20 20 |er). n|ame: |
|00000660| 20 20 4e 75 6d 62 65 72 | 20 20 0d 20 20 20 63 6c | Number| . cl|
|00000670| 61 73 73 3a 20 20 20 20 | 20 6e 75 6d 20 20 20 20 |ass: | num |
|00000680| 20 0d 20 20 20 74 79 70 | 65 3a 20 20 20 20 20 20 | . typ|e: |
|00000690| 72 65 61 6c 20 20 20 20 | 0d 20 20 20 20 20 6e 72 |real |. nr|
|000006a0| 3a 20 20 20 20 20 20 31 | 20 20 20 20 20 20 20 0d |: 1| .|
|000006b0| 20 20 20 20 20 6e 63 3a | 20 20 20 20 20 20 31 20 | nc:| 1 |
|000006c0| 20 20 20 20 20 20 0d 3e | 20 4e 75 6d 62 65 72 20 | .>| Number |
|000006d0| 3d 20 69 6e 70 75 74 28 | 22 47 69 6d 6d 65 20 61 |= input(|"Gimme a|
|000006e0| 20 6e 75 6d 62 65 72 3a | 22 2c 20 22 73 22 29 0d | number:|", "s").|
|000006f0| 47 69 6d 6d 65 20 61 20 | 6e 75 6d 62 65 72 3a 32 |Gimme a |number:2|
|00000700| 2e 33 34 35 36 0d 20 4e | 75 6d 62 65 72 20 3d 0d |.3456. N|umber =.|
|00000710| 32 2e 33 34 36 0d 3e 20 | 74 79 70 65 28 4e 75 6d |2.346.> |type(Num|
|00000720| 62 65 72 29 0d 73 74 72 | 69 6e 67 0d 5c 65 6e 64 |ber).str|ing.\end|
|00000730| 7b 76 65 72 62 61 74 69 | 6d 7d 0d 0d 53 65 65 20 |{verbati|m}..See |
|00000740| 61 6c 73 6f 3a 20 50 61 | 67 65 7e 5c 70 61 67 65 |also: Pa|ge~\page|
|00000750| 72 65 66 7b 66 6e 3a 67 | 65 74 6c 69 6e 65 7d 20 |ref{fn:g|etline} |
|00000760| 5c 76 65 72 62 2b 67 65 | 74 6c 69 6e 65 28 29 2b |\verb+ge|tline()+|
|00000770| 2e 0d 0d 5c 6e 65 77 70 | 61 67 65 0d 0d 0d 0d |...\newp|age.... |
+--------+-------------------------+-------------------------+--------+--------+